package p0914;

import java.util.List;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;



public class TestDemo {

	/**
	 * @param args
	 */
public static String[] LIST ={"war","war assets administration","war between the states","war brides act","war casualties"};
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://gov.bowker.com/gis/login");
WebElement username = driver.findElement(By.id("username"));
username.sendKeys("gistestacct");
WebElement password= driver.findElement(By.id("password"));
password.sendKeys("welcome");
WebElement login = driver.findElement(By.id("submit"));
login.click();
WebElement inputbox = driver.findElement(By.id("searchText_0"));
inputbox.sendKeys("war");
//try {
//	Thread.sleep(500);
//} catch (InterruptedException e) {
//	// TODO Auto-generated catch block
//	e.printStackTrace();
//}

driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
WebElement web1 = driver.findElement(By.className("t-autocomplete-menu"));
List<WebElement> li = web1.findElement(By.tagName("ul")).findElements(By.tagName("li"));
for (int i = 0; i < li.size(); i++) {
	System.out.println(li.get(i).getText());
}

li.get(1).click();



	}

}
